package com.example.goodog.customViews;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.View;

import com.example.goodog.R;

public class WebSiteButton extends ListViewButton {

	private String URL;
	
	public WebSiteButton(Context c) {
		this(c,"");
	}
	
	public WebSiteButton(Context c, String i_URL) {
		super(c,R.drawable.website);

		URL = i_URL;

		this.setOnClickListener(new View.OnClickListener() {
            
	           @Override
	           public void onClick(View v) {
	                
	        	   String url = URL;
	        	   Intent i = new Intent(Intent.ACTION_VIEW);
	        	   i.setData(Uri.parse(url));
	        	   ((Activity)(v.getContext())).startActivity(i);           
	           }
	       });
	}
}
